﻿using CarouselView.Contracts;
using CarouselView.Platforms.Android;
using CarouselView.Services;
using CarouselView.ViewModels;
using Microsoft.Extensions.Logging;

namespace CarouselView
{
    public static class MauiProgram
    {
        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            builder
                .UseMauiApp<App>()
                .UseMauiCarouselView()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                });

#if DEBUG
		builder.Logging.AddDebug();
#endif

            builder.Services.AddScoped<MainPage>();
            builder.Services.AddScoped<MainViewModel>();

            builder.Services.AddScoped<IDownloadContract, WebClientDownload>();

#if ANDROID
            builder.Services.AddScoped<IDirectoryContract, DirectoryService>();
#endif

            return builder.Build();
        }
    }
}